<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<meta name="decorator" content="sysDefault" />
	<script src="${staticPath}/lib/jquery-datatables/1.9.4/js/jquery.dataTables.min.js" type="text/javascript"></script>
	<script type="text/javascript">
	$(document).ready(function() {
	});
	function funform(url,target){
		window.open(url,target);
	}

	function formSubmit(value){
		document.getElementById("jobForm").action = value;
		document.getElementById("jobForm").submit();
	}
	
	
	</script>
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<div class="panel panel-default">
				  <div class="panel-heading">
				    <h3 class="panel-title">新增定时任务
						<a class="btn btn-default btn-sm pull-right" role="button" href="javascript:void(0)" onclick="history.go(-1)">返回</a>
				    </h3>
				  </div>
				  <div class="panel-body">
					<form:form id="jobForm" modelAttribute="job" action="" method="post" class="form-horizontal" role="form">

						<form:hidden path="id" id="id"/>
						<form:hidden path="status" id="status"/>
						
						<tags:message content="${message}"/>
						<div class="form-group">
							<label for="name" class="col-sm-2 control-label">任务名：</label>
							<div class="col-sm-2">
								<form:input id="name" path="name" maxlength="20" class="form-control "/>
								<span id="name" class="requiredSpan" style="color: red;"></span>
							</div>
						</div>
						<div class="form-group">
							<label for="cronExpression" class="col-sm-2 control-label">CRON表达式：</label>
							<div class="col-sm-2">
								<form:input id="cronExpression" path="cronExpression" maxlength="20" class="form-control required"/>
							</div>
						</div>
						<div class="form-group">
							<label for="clazz" class="col-sm-2 control-label">任务类：</label>
							<div class="col-sm-4" style="width: 200">
								<form:input id="clazz" path="clazz"  class="form-control required " />
							</div>
						</div>
						<div class="form-group">
							<label for="memos" class="col-sm-2 control-label">任务描述：</label>
							<div class="col-sm-6">
								<form:textarea path="memos" id="memos" class="form-control required"/>
							</div>
						</div>
						<div class="form-group">
						  <div class="col-sm-offset-2 col-sm-10">
						  	<c:if test="${job.id == null}">
						   	    <input class="btn btn-primary" type="button" value="保 存"  onclick="formSubmit('${contextPath}/sys/quartz/job/addJob')" />
						    </c:if>
						    <c:if test="${job.id != null}">
							     <input class="btn btn-primary" type="button" value="保 存" onclick="formSubmit('${contextPath}/sys/quartz/job/upJob')" />
							</c:if>
							<input class="btn btn-default" type="button" value="返 回" onclick="history.go(-1)"/>
						  </div>
						</div>
					</form:form>
				  </div>
				</div>			
			</div>
		</div>
	</div>
</body>
</html>